/*
 * seqio.h
 *
 *  Created on: Oct 30, 2013
 *      Author: jiang
 */

#ifndef SEQIO_H_
#define SEQIO_H_

#include <stdint.h>
#include "kseq.h"
#include "util.h"
#include "utils.h"
#include "lookup.h"


typedef uint16_t cigar_t;

typedef struct{
	char *name;
	ubyte_t *seq,*qual;
	uint32_t aln_pos;
	cigar_t cigar;
	uint32_t len;
	uint32_t qual_len;

    /*
	int32_t *shifts; //Positions that has distinct Kmer
	int32_t *positions; //Kmer position in reference
	uint32_t kmerN; //number of distinct kmer.  Always < =  opt->firstZ
	*/

}read_t;


typedef struct{
	// for fastq input
	kseq_t *ks;
}seqio_t;


#ifdef __cplusplus
extern "C" {
#endif
	seqio_t *seq_open(const char *fn);
	int table_dump(char *fn,const table_t *kmer_position_table, int arrayTypeTable);
	table_t *table_restore(const char *fn);
	void free_read_seq(int n_seqs, read_t *seqs);
	uint8_t *indicatorArray_restore(const char *fn);
	int indicatorArray_dump(char *fn,const uint8_t *kmerStrandIndicator);

#ifdef __cplusplus
}
#endif





#endif /* SEQIO_H_ */
